package com.platform.base.service.impl;

import java.util.List;
import java.util.Arrays;
import com.platform.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.platform.base.mapper.CollectorTypeMapper;
import com.platform.base.domain.CollectorType;
import com.platform.base.service.ICollectorTypeService;
import com.platform.common.core.text.Convert;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;

/**
 * 采集器类型Service业务层处理
 * 
 * @author wangqi
 * @date 2020-09-25
 */
@Service
public class CollectorTypeServiceImpl extends ServiceImpl<CollectorTypeMapper,CollectorType> implements ICollectorTypeService
{
    @Autowired
    private CollectorTypeMapper collectorTypeMapper;

    /**
     * 查询采集器类型列表
     * 
     * @param collectorType 采集器类型
     * @return 采集器类型
     */
    @Override
    public List<CollectorType> selectCollectorTypeList(CollectorType collectorType)
    {
        return collectorTypeMapper.selectCollectorTypeList(collectorType);
    }

    /**
     * 新增采集器类型
     * 
     * @param collectorType 采集器类型
     * @return 结果
     */
    @Override
    public int insertCollectorType(CollectorType collectorType)
    {
        collectorType.setCreateTime(DateUtils.getNowDate());
        return collectorTypeMapper.insert(collectorType);
    }

    /**
     * 修改采集器类型
     * 
     * @param collectorType 采集器类型
     * @return 结果
     */
    @Override
    public int updateCollectorType(CollectorType collectorType)
    {
        collectorType.setUpdateTime(DateUtils.getNowDate());
        return collectorTypeMapper.updateById(collectorType);
    }

    /**
     * 删除采集器类型对象
     * 
     * @param ids 需要删除的数据ID
     * @return 结果
     */
    @Override
    public int deleteCollectorTypeByIds(String ids)
    {
        return collectorTypeMapper.deleteBatchIds(Arrays.asList(Convert.toStrArray(ids)));
    }
}
